﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GrayParrot.Extensions.Strings
{
    public static partial class StringExtensions
    {
        /// <summary>
        /// Determines whether a string of characters is contained in another performing specific string comparison...
        /// </summary>
        /// <param name="source">The source string</param>
        /// <param name="toCheck">The string to check</param>
        /// <param name="comp">The comparison applied</param>
        /// <returns></returns>
        public static bool Contains(this string source, string toCheck, StringComparison comp)
        {
            if (string.IsNullOrEmpty(toCheck) || string.IsNullOrEmpty(source))
                return false;

            return source.IndexOf(toCheck, comp) >= 0;
        } 
    }
}
